//
//  KLVideoCallButton.m
//  测试webRTC
//
//  Created by kinglian_iOS_000 on 2017/9/4.
//  Copyright © 2017年 静持大师. All rights reserved.
//

#import "KLVideoCallButton.h"
#import "UIView+Frame.h"

@implementation KLVideoCallButton

- (void)awakeFromNib {
    [super awakeFromNib];
    
    [self setupUI];
}

- (instancetype)init {
    if (self = [super init]) {
        [self setupUI];
    }
    
    return self;
}

- (instancetype)initWithFrame:(CGRect)frame {
    if (self = [super initWithFrame:frame]) {
        [self setupUI];
    }
    
    return self;
}

- (void)setupUI {
    self.clipsToBounds = NO;
    
    self.backgroundColor = [UIColor clearColor];

    self.titleLabel.font = [UIFont systemFontOfSize:12];
    self.titleLabel.textAlignment = NSTextAlignmentCenter;
}

- (void)layoutSubviews {
    [super layoutSubviews];
    
    self.imageView.frame = CGRectMake(0, 0, self.width, self.width);
    
    self.titleLabel.width = self.width * 2;
    self.titleLabel.height = 20;
    self.titleLabel.centerX = self.width * 0.5;
    self.titleLabel.bottom = self.height;
    
    self.titleLabel.textColor = [UIColor whiteColor];
}

@end
